$(document).ready(function () {


    var preCategory = getUrlParameter("category");
    console.log('preCategory' + preCategory);

    $('#cur-category').text(preCategory);

    // //处理首页点击事件， 如果点击展示某一类别病，展开子目录
    // $('.thumbnail').click(function(e) {
    // 	var dataTarget = $(this).attr('data-target');
    // 	// console.log(category);
    // 	var curCategory = preCategory + '>' + dataTarget;
    // 	$(location).attr('href', 'sub-outline?category=' + curCategory);
    // });

    $('.list-group-item').click(function (e) {
        var dataTarget = $(this).attr('data-target');

        var curCategory = preCategory + '>' + dataTarget;
        $(location).attr('href', 'sub-outline?category=' + curCategory);
    });


    //返回
    $('.fa-chevron-left').click(function () {
        console.log('返回');
        var curCategory = '';
        var pcList = preCategory.split('>');
        if(preCategory === ''  || pcList.length === 1){
            $(location).attr('href', 'home');
            return;
        }else{
            for(var i = 0; i < pcList.length - 1; i++){
                curCategory += pcList[i] + '>';
            }
            $(location).attr('href', 'sub-outline?category=' + curCategory);
        }
    })
});
